/*
 *  $TEAM_NAME Space Trader
 */
package views;

import models.TradeGood;

import javax.swing.table.TableCellRenderer;
import javax.swing.JTable;
import javax.swing.JLabel;
import java.awt.Component;
import java.awt.Color;

/**
 * Trade Good cell renderer for market place table
 * @author twb
 * @version 1.0
 */
public class TradeGoodCellRenderer extends JLabel implements TableCellRenderer {
	
	/**
	 * Construct a tradge good cell renderer
	 */
    public TradeGoodCellRenderer() {
        super.setOpaque(true);
    }

    /**
     * get the table cell renderer component
     * @param table
     * @param good
     * @param isSelected
     * @param hasFocus
     * @param row
     * @param height
     * @return the renderer
     */
    public Component getTableCellRendererComponent(
    		JTable table, Object good, boolean isSelected, 
    		boolean hasFocus, int row, int height) {
        final TradeGood tradegood = (TradeGood) good;
        System.out.println(tradegood);

        setBackground(Color.RED);
        return this;
    }
}
